1 <!--/****************************** Module Header ******************************\
2 * Module Name: GeneralProblems.xaml
3 * Project: CSSL3DataBinding
4 * Copyright (c) Microsoft Corporation.
6 * This module contains documentation of general problems developers may meet with
7 * when using DataBinding in SL3. There's no sample code regarding DataBinding in
10 * This source is subject to the Microsoft Public License.
11 * See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
12 * All other rights reserved.
15 * * 11/26/2009 06:00 PM Allen Chen Created
16 \***************************************************************************/-->
18 <UserControl x:Class="CSSL3DataBinding.GeneralProblems"
19 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
20 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
21 xmlns:local="clr-namespace:CSSL3DataBinding"
22 Width="1400" Height="1300">
23 <Grid x:Name="LayoutRoot" Background="White">
25 <TextBlock FontSize="24" Text="What Cannot be Bound:"></TextBlock>
26 <TextBlock Foreground="Red"><Run Text="To support data binding, the target class must inherit from FrameworkElement or CollectionViewSource."/><LineBreak/><Run Text="A general problem is mistakenly use Binding in XMAL."/><Run Text=" "/><LineBreak/><Run Text="For instance, we cannot bind Run objects in XAML."/><LineBreak/><Run Text="In SL3, the following code will cause XAML parse exception:"/><LineBreak/><Run Foreground="Black" Text=" <TextBlock>"/><LineBreak/><Run Foreground="Black" Text=" <Run Text="{Binding Name}"></Run> "/><LineBreak/><Run Foreground="Black" Text=" </TextBlock>"/><LineBreak/><Run Foreground="#FFFC0606" Text="In addition, the binding target property must be DependencyProperty. For more details please refer to the"/><LineBreak/><Run Foreground="#FFFC0606" Text="following MSDN documentation:"/><LineBreak/><Run Foreground="#FFFC0606" Text=""/></TextBlock>
27 <HyperlinkButton NavigateUri="http://msdn.microsoft.com/en-us/library/cc221408(VS.95).aspx" Content="http://msdn.microsoft.com/en-us/library/cc221408(VS.95).aspx" Foreground="#FF0088FF"></HyperlinkButton>